// fsearch.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "FSearch.h"

#include <iostream>
#include <cassert>

#define TEST_(s) (void)(std::cout << #s << " = " << s << std::endl) 

int main(int argc, char* argv[])
{
	double d[] = { 1, NAN, NAN, NAN, NAN, NAN, NAN, 8, 9, NAN, NAN, 12, 13, NAN };
	std::vector<double> v(d, d + sizeof(d)/sizeof(*d));

	for(int i = 0 ; i != v.size() ; ++i)
		std::cout << v[i] << " ";
	std::cout << std::endl;

	FSearch fuzzy;

	TEST_(fuzzy.find(v, 4.5));
	TEST_(fuzzy.find(v, 1));
	TEST_(fuzzy.find(v, 7));
	TEST_(fuzzy.find(v, 8.5));
	TEST_(fuzzy.find(v, 2));
	TEST_(fuzzy.find(v, 13.1));

	return 0;
}

